package com.likeyoudo.common.enums;


import com.likeyoudo.common.R;

/**
 * @author LikeYouDo
 * @date 2023/11/29 14:53
 */
public enum DictEnum {
    PRIMARY("primary", R.color.state_success, R.drawable.state_success),
    SUCCESS("success", R.color.state_success, R.drawable.state_success),
    WARNING("warning", R.color.state_warning, R.drawable.state_warning),
    DANGER("danger", R.color.state_danger, R.drawable.state_danger),
    ;

    private String elTagType;
    private int textColor;
    private int resId;

    DictEnum(String elTagType, int textColor, int resId) {
        this.elTagType = elTagType;
        this.textColor = textColor;
        this.resId = resId;
    }

    public static DictEnum getDictEnumByType(String elTagType) {
        for (DictEnum value : DictEnum.values()) {
            if (value.elTagType.equals(elTagType)) {
                return value;
            }
        }
        // 为空则默认
        return PRIMARY;
    }

    public String getElTagType() {
        return elTagType;
    }

    public void setElTagType(String elTagType) {
        this.elTagType = elTagType;
    }

    public int getTextColor() {
        return textColor;
    }

    public void setTextColor(int textColor) {
        this.textColor = textColor;
    }

    public int getResId() {
        return resId;
    }

    public void setResId(int resId) {
        this.resId = resId;
    }
}
